$(function(){ 
	init();
}); 
function init(){


	$("#queryBtn").on('click',function(){
		var queryauthor = $("#queryauthor").val();
		var querytitle = $("#querytitle").val();
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		window.location.href="/TeaCulture/newmessagelist/query?author="+queryauthor+"&&title="+querytitle+"&&startTime="+startTime+"&&endTime="+endTime;
	});
}
function update(id){
	window.location.href="/TeaCulture/createNewMessage/update?newMessage_id="+id;

}
function deletes(id){
	$.ajax({
	   	 type : "post",
	        url : "/TeaCulture/newmessagelist/delete",
	        data : { "newMessage_id" : id  },
	        dataType : "json",
	        traditional : true,
	        success : function(result){
	   
	       	 if(result.result.code === "1"){	       		
	       		location.reload();
	       	 }else{
	       		 alert(result.result.des);
	       	 }
	       	
	       },    
	       error : function(result){
	    	  alert(result.result.des);
	       }
	});
}
